package com.sunwayhorizo.health.business.clinic.consultation.query;

import java.util.Date;
import java.util.List;

import javax.ejb.Local;

import com.sunwayhorizo.health.business.base.query.BaseQueryLocal;
import com.sunwayhorizo.health.hl7.common.Hl7Exception;
import com.sunwayhorizo.health.hl7.rim.ActParticipation;
import com.sunwayhorizo.health.hl7.rim.Observation;

@Local
public interface ConsultationQueryLocal extends BaseQueryLocal
{
    /**
     * 查询科室会诊
     * 
     * @param workgroupId
     * @param type
     * @param status
     * @param from
     * @param to
     * @param pageSize
     * @param pageNo
     * @return
     * @throws Hl7Exception
     */
    List<ActParticipation> findObservationInGroup(String workgroupId, String type, String status, Date from, Date to, int pageSize, int pageNo)
        throws Hl7Exception;


    /**
     * 查询科室会诊总记录
     * 
     * @param workgroupId
     * @param type
     * @param status
     * @param from
     * @param to
     * @return
     * @throws Hl7Exception
     */
    long findCountObservationInGroup(String workgroupId, String type, String status, Date from, Date to) throws Hl7Exception;


    /**
     * 查询我的会诊
     * 
     * @param workgroupId
     * @param type
     * @param status
     * @param from
     * @param to
     * @param pageSize
     * @param pageNo
     * @return
     * @throws Hl7Exception
     */
    List<ActParticipation> findMyObservation(String workgroupId, String type, String status, Date from, Date to, int pageSize, int pageNo)
        throws Hl7Exception;


    /**
     * 根据会诊单号查询会诊
     * 
     * @param consultationId
     * @return
     * @throws Hl7Exception
     */
    Observation findObservationByConsultationId(String consultationId) throws Hl7Exception;


    /**
     * 根据会诊单号查询参与
     * 
     * @param consultationId
     * @return
     * @throws Hl7Exception
     */
    List<ActParticipation> findParitcipationsByConsultationId(String consultationId) throws Hl7Exception;


    /**
     * 查询我的会诊总记录
     * 
     * @param emplyeeId
     * @param type
     * @param status
     * @param from
     * @param to
     * @return
     * @throws Hl7Exception
     */
    long findCountMyObservation(String emplyeeId, String type, String status, Date from, Date to) throws Hl7Exception;

}
